package main

import (
	"fmt"
	"encoding/json"
	"marshal/jsonmarshal"
)

func main() {
	type PlayerGroup struct {
		Number     int  `mytag:"Number"`
		Name   string  `mytag:"Name"`
		Teams []string  `mytag:"Teams,omitempty"`
		Position string  `mytag:"Position,omitempty"`
	}
	player := PlayerGroup{
		Number:     23,
		Name:   "James",
		Teams: []string{"Lakers", "Heat", "Cavaliers"},
		Position: "SF",
	}

	byte, err := jsonmarshal.JsonMarshal(player)
	want, _ := json.Marshal(&player)
	if err != nil {
		fmt.Println("err.Error()")
	}
	fmt.Println(string(byte))
	fmt.Println(string(want))
}
